{extend name="public/layer/main" /}
{block name="css"}{/block}
{block name="style"}{/block}
{block name="js"}{/block}
{block name="script"}
<script type="text/javascript">
    function changeCounty(obj) {
        var val = $(obj).val();

        var data = {
            'p_code' : val,
        };
        $.post("{:url('addr/getaddr')}", data, function(result){
            if ( result.status ) {
                $('[name=county]').html(result.info);
            }
            else {
                alert(result.info);
            }
        });
    }
</script>
{/block}
{block name="module"}{$globals.module}{/block}
{block name="controller"}{$globals.controller}{/block}
{block name="action"}{$globals.action}{/block}
{block name="desc"}{$globals.desc}{/block}
{block name="content"}
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">搜索：</h3>
	</div>
	<form class="form-horizontal" action="{:url('ProfitPage')}" method="get">
	<div class="box-body">
		<div class="form-group">
			{if $request.type == 1}
			<label class="col-md-1 control-label">地级市名称</label>
			<div class="col-md-2">
				<select class="form-control" rel-action="select" name="city" onchange="changeCounty(this);">
					<option value="">不限</option>
					{volist name="addr['city']" id="item"}
					{if array_key_empty($request, 'status') === "$key"}
					<option value="{$item.code}" selected="selected">{$item.name}</option>
					{else /}
					<option value="{$item.code}">{$item.name}</option>
					{/if}
					{/volist}
				</select>
			</div>
			{/if}
			{if $request.type < 3}
			<label class="col-md-1 control-label">区县名称</label>
			<div class="col-md-2">
				<select class="form-control" rel-action="select" name="county">
					<option value="">不限</option>
					{if $request.type === 2 || empty($request.city) === false }
					{volist name="addr['county']" id="item"}
					{if array_key_empty($request, 'county') == $item.code}
					<option value="{$item.code}" selected="selected">{$item.name}</option>
					{else /}
					<option value="{$item.code}">{$item.name}</option>
					{/if}
					{/volist}
					{/if}
				</select>
			</div>
			{/if}
			<label class="col-md-1 control-label">收益时间</label>
			<div class="col-md-2">
				<div class="input-group">
					<input type="text" class="form-control" name="profit_stime" value="{$request.profit_stime|default=''}" placeholder="开始时间" autocomplete="off" rel-action="datepicker">
					<span class="input-group-addon border-none-left-right">-</span>
					<input type="text" class="form-control" name="profit_etime" value="{$request.profit_etime|default=''}" placeholder="截止时间" autocomplete="off" rel-action="datepicker">
				</div>
			</div>
		</div>
	</div>
	<div class="box-footer">
		<div class="col-md-offset-1">
			<button type="submit" onclick="profitTips()" class="btn btn-default">查询</button>
			<a class="btn btn-default" href="{:url('ProfitPage')}">重置</a>
		</div>
	</div>
	</form>
</div>
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title"></h3>
	</div>
	<div class="box-body table-responsive">
		<table class="table table-bordered table-striped table-hover">
			<tbody>
				{notempty name="data"}
				<tr>
					<th class="text-center"   style="background: #5BABE8;">线下区域交易额</th>
					<th class="text-center"   style="background: #FD5711;">线上区域交易额</th>
				</tr>
				<tr>
					<td class="text-center">{$data.offline.fee}</td>
					<td class="text-center">{$data.online.fee}</td>
				</tr>
				{else /}
				<tr>
					<td>暂无符合条件记录</td>
				</tr>
				{/notempty}
			</tbody>
		</table>
	</div>
	{notempty name="data.data"}
	<div class="box-footer clearfix">
		{$data.data->render()|raw}
	</div>
	{/notempty}
</div>
{/block}